Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v2] migrate to Operator SDK v1.0.0 #1007

Merged
merged 4 commits into from
Aug 19, 2020
Merged

Conversation

zroubalik
Copy link
Member

@zroubalik zroubalik commented Aug 18, 2020

Signed-off-by: Zbynek Roubalik [email protected]

OMG, sorry for the huge PR, there wasn't an easy way how to split things.

Operator SDK is finally in 1.0.0 version, this brought change in the project layout and other stuff. Now it is internally using Kubebuilder for project scaffolding and kustomize to generate YAML manifests. See the migration guide for details:
https://sdk.operatorframework.io/docs/building-operators/golang/project_migration_guide/

What was changed

  • The deploy directory was replaced with the config directory including a new layout of Kubernetes manifests files:
    • CRD manifests in deploy/crds/ are now in config/crd/bases
    • CR manifests in deploy/crds/ are now in config/samples
    • Controller manifest deploy/operator.yaml is now in config/manager/manager.yaml
    • RBAC manifests in deploy are now in config/rbac/
    • Metrics server manifests are now in config/metrics-server
  • build/Dockerfile andbuild/Dockerfile.adapter are moved to the project root directory
    • Dockerfiles were changed to multi-stage and distroless, this should reduce image size
  • pkg/apis and pkg/controllers are now in the root directory.
    • there were only minor changes in the api and controllers code
  • cmd/manager/main.go is now in the root director
  • cmd/adapter/main.go is now in adapter/main.go
  • kustomize is used to manage Kubernetes resources needed to deploy your operator
  • Makefile was modifed a lot, eg. you can use make deploy to deploy KEDA, make run to run locally and other useful steps
  • Release process was simplified (no need to manually change version etc.) everything should be part of GitHub Release Action now
  • We produce one release yaml file that contains all resources (eg. keda-2.0.0.yaml) instead of .zip or tar.gz artifacts
  • We could use envtest test framework to test our controllers. The current test file is just a stub: https://github.com/kedacore/keda/blob/950c5e16deb143a8201189ec7430f7350d0fa6bd/controllers/suite_test.go

Checklist

  • Commits are signed with Developer Certificate of Origin (DCO)
  • Changelog has been updated

Fixes #969

Signed-off-by: Zbynek Roubalik <[email protected]>
Makefile Outdated Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
Copy link
Contributor

@ahmelsayed ahmelsayed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great @zroubalik! Thanks for doing all that. I just had a couple of questions, but it looks good to me.

Zbynek Roubalik added 3 commits August 19, 2020 10:11
Signed-off-by: Zbynek Roubalik <[email protected]>
Signed-off-by: Zbynek Roubalik <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants